package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	UserName string `gorm:"type:varchar(20);not null;comment:'用户名'"`
	Phone    string `gorm:"type:char(32);not null;comment:'手机号'"`
	Password string `gorm:"type:char(32);not null;comment:'密码'"`
}

func (u *User) Find(userId int) error {
	return DB.Where("user_id =?", userId).Find(&u).Error
}
